remotemanager.decorators.magic module

class remotemanager.decorators.magic.RCell(**kwargs: Any)[source]

Magic function that allows running an ipython cell on a remote machine with minimal lines of code.

sanzu(line: str, cell: str, local_ns: dict) None[source]

Execute a decorators cell using an implicit remote Dataset

Parameters:
  • line – magic line, includes arguments for cell and Dataset

  • cell – Cell contents

  • local_ns – dict containing current notebook runtime attributes

parse_line(cell: list, fargs: list, pull: list)[source]

Generate a callable function from the remaining cell content

Parameters:
  • pull – (list): list of object names to add to return instead of final line

  • cell – (list): cell content

  • fargs – (list): function arguments

Returns:

formatted function string

Return type:

(str)

extract_in_scope(line: str, local_ns: dict)[source]

This will convert a line to a dictionary of arguments.

It is separated out because we are going to have to selectively populate the local scope with local_ns.

parse_tree(fstr, add_return: bool = True)[source]

This routine adds a return to the end of our generated function.